/*
 * @Author: szx
 * @Date: 2022-02-04 22:58:50
 * @LastEditTime: 2022-02-04 23:04:25
 * @Description:
 * @FilePath: \leetcode\1700-1799\1725\1725.js
 */
/**
 * @param {number[][]} rectangles
 * @return {number}
 */
var countGoodRectangles = function (rectangles) {
    let res = 0;
    let max = -1;
    for (let r of rectangles) {
        const min = Math.min(r[0], r[1]);
        if (min > max) {
            max = min;
            res = 1;
        } else if (min == max) {
            res++;
        }
    }
    return res;
};
